How to use macros with the conversion plugin.

1. It is necessary to use the LibreOffice plugin to make the conversion.

2. Open with a text editor the macros file.

This file is located in the home directory of the user that is going to make the conversion.
For example with the default configuration for the apache web server, it is located in the path /var/www/.config/libreoffice/4/user/basic/Standard/Module1.xba.
Or using FastCGI as PHP handler, this file is located at .config/libreoffice/4/user/basic/Standard/Module1.xba of ther user's folder.
If the directory .config/libreoffice, doesn’t exists, make a first conversion so LibreOffice generates this path structure.

3. In the opened file, add the new macro. You may find the available macros in the macros folder.

4. You can now use the new macro.

These are the available method:

Generate TOC when transforming to PDF:

$docx->transformDocument('example_text.docx', 'example_text.pdf', null, array('toc' => true));

Generate PDF/A-1:

$docx->transformDocument('example_text.docx', 'example_text.pdf', null, array('pdfa1' => true));

Generate TOC when transforming to PDF/A-1:

$docx->transformDocument('example_text.docx', 'example_text.pdf', null, array('toc' => true, 'pdfa1' => true));

Get the document statistics:

$docx->getStatistics('example_text.docx');